package com.woniu.goods.service;

import com.github.pagehelper.PageHelper;
import com.github.pagehelper.PageInfo;
import com.woniu.goods.entity.Goods;
import com.woniu.goods.entity.Order;
import com.woniu.goods.mapper.OrderMapper;
import com.woniu.goods.vo.OrderVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class OrderServiceImpl implements OrderService {

    @Autowired
    OrderMapper orderMapper;

    @Override
    public PageInfo<OrderVo> queryOrderByPage( Integer userid, Integer now, Integer size) {
        PageHelper.startPage(now,size);
        List<OrderVo>list=orderMapper.selectOrderBypage(userid);
        return new PageInfo<OrderVo>(list);
    }

    @Override
    public int deleteOrder(int id) {
        return orderMapper.deleteByPrimaryKey(id);
    }
}
